package com.peter.aop.aopdemo.controller;

import com.peter.aop.aopdemo.logOperation.OperationLog;
import com.peter.aop.aopdemo.service.OperLogService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * ClassName: UserController
 * author: bob.ly
 * Version: 1.0.0
 * DateTime: 2021/08/18-22:31:00
 * Description:
 */
@RestController
@RequestMapping("/test")
public class UserController {

    @Resource
    private OperLogService operLogService;

    @GetMapping("/aop")
    public String testAop(@RequestParam(value = "name") String name) {
        System.out.println(name);
        operLogService.update(10L);
        return name;
    }
}
